home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 2: CDPD 1
/
Almathera Ten on Ten - Disc 2: CDPD 1.iso
/
pd
/
351-375
/
359
/
dice
/
dice.lzh
/
lib
/
amiga
/
muls.a
< prev
next >
Wrap
Text File
|
1990-04-16
|
618b
|
40 lines
; muls
;
; (c)Copyright 1990, Matthew Dillon, All Rights Reserved
;
; 32x32->32 multiply
;
; args on stack, return result on stack
;
; CANNOT DESTROY ANY REGS
;
; 8sp 10sp
; 4sp 6sp
section text,code
xdef __muls
xdef __mulu
__mulu:
__muls:
movem.l D0/D1,-(sp) ; 0=D0H 2=D0L 4=D1H 6=D1L
swap D0 ; D0H
mulu.w D1,D0 ; D1L -> D0
swap D1 ; D1H
mulu 2(sp),D1 ; D0L -> D1
add.l D1,D0 ; + -> D0 (D1 free)
swap D0
clr.w D0
move.w 2(sp),D1 ; D0L
mulu.w 6(sp),D1 ; D1L
add.l D1,D0
addq.l #8,sp ; restore stack
rts
END